// 订单列表页面
import request from '../request/request';

// 获取订单列表
export const fetchOrderList = (userId) => {
  return request({
    url: '/order/index',
    method: 'post',
    data: { user_id: userId },
  });
};

// 删除订单
export const deleteOrder = (orderId) => {
  return request({
    url: '/order/del',
    method: 'post',
    data: { id: orderId },
  });
};


// 订单退款/支付状态
export const updateOrderStatus = (userId, status, orderId) => {
  return request({
    url: '/order/refund',
    method: 'post',
    data: { 
      user_id: userId, 
      status, 
      id: orderId 
    },
  });
};